package com.rxkj.service.impl;

import com.rxkj.entity.sys.SysOprateLog;
import com.rxkj.mapper.SysOPLogMapper;
import com.rxkj.service.SysOPLogService;
import com.rxkj.utils.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysOPLogServiceImpl implements SysOPLogService {

    @Autowired
    private SysOPLogMapper sysOPLogMapper;

    @Override
    public Integer savesyslog(SysOprateLog sopl) {
        return sysOPLogMapper.savesyslog(sopl);
    }

    //todo
    @Override
    public List<SysOprateLog> getlogbypage(Integer page, Integer pagenum) {
        return null;
    }

    @Override
    public PageData<SysOprateLog> querySysLog(int currentPage, int pageSize) {
        Integer totalRows = sysOPLogMapper.getTotalRows();
        PageData<SysOprateLog> res = new PageData<SysOprateLog>(currentPage,pageSize,(long) totalRows);
        List<SysOprateLog> qe = sysOPLogMapper.querySysLog(res.getStart(), res.getEnd());
        res.setRows(qe);
        return res;
    }
}
